<div class="tabs-container">

    <div class="tab-content">
        <div id="tab-1" class="tab-pane active">

            <div class="panel-body">
                <div class="row">

                    <div class="col-sm-12">
                        <div class="m-b-md">
                            <h3> {{$plan->name}}</h3>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <dl class="dl-horizontal">
                           {{-- <dt>盘点条件：</dt>
                            <dd>{{$plan->condition_text}}</dd>--}}
                            <dt>盘点状态：</dt>
                            <dd>{{$plan->status_text}}</dd>
                            <dt>盘点总数：</dt>
                            <dd>{{$plan->take_total}}</dd>
                           {{-- <dt>盈亏数：</dt>
                            <dd>{{$plan->profit_count}}</dd>
                            <dt>盈亏金额（元）：</dt>
                            <dd>{{$plan->profit_amount}}</dd>--}}
                            <dd> <a class="export-goods btn btn-primary" data-toggle="modal"
                                    data-target="#download_modal" data-backdrop="static" data-keyboard="false"
                                    data-link="{{route('admin.shop.take.stock.plan.getExportData',['type'=>'xls','plan_id'=>$plan->id])}}"
                                    id="xls"
                                    data-url="{{route('admin.export.index',['toggle'=>'xls'])}}"
                                    data-type="xls"
                                    href="javascript:;">导出</a></dd>
                        </dl>
                    </div>
                </div>


                <div class="hr-line-dashed"></div>

                <div class="table-responsive">

                    <table class="table table-hover table-striped">
                        <tbody>
                        <!--tr-th start-->
                        <tr>
                            <th>商品</th>
                            <th>货号</th>
                            <th>SKU</th>
                            <th>颜色</th>
                            <th>尺码</th>
                            {{--<th>采购价</th>--}}
                            <th>盘点数量</th>
                           {{-- <th>盘点前数量</th>
                            <th>盈亏数</th>
                            <th>盈亏金额</th>--}}
                            {{--<th>状态</th>--}}
                        </tr>
                        <!--tr-th end-->
                        @if($lists->count()>0)
                            @foreach ($lists as $item)
                                <tr>
                                    <td>{{$item->product->goods->name}}</td>
                                    <td>{{$item->product->goods->goods_no}}</td>
                                    <td>{{$item->product->sku}}</td>
                                    <td>{{$item->meta['color']}}</td>
                                    <td>{{$item->meta['size']}}</td>
{{--                                    <td>{{$item->product->goods->factory_price}}</td>--}}
                                    <td>{{$item->count}}</td>
                                    {{--<td>{{$item->before_count}}</td>
                                    <td>{{$item->difference_count}}</td>
                                    <td>{{$item->difference_amount}}</td>--}}
{{--                                    <td>{{$item->status==1?'已核实':'待核实'}}</td>--}}
                                </tr>
                            @endforeach
                        @endif
                        </tbody>
                        <tfoot>
                        <tr>
                            <td colspan="11" class="footable-visible">
                                {!! $lists->render() !!}
                            </td>
                        </tr>
                        </tfoot>
                    </table>

                    @if($lists->count())
                        <a href="javascript:;" class="btn btn-xs btn-primary"
                           data-toggle="modal-plan-items"
                           data-target="#modal" data-backdrop="static" data-keyboard="false"
                           data-url="{{route('admin.shop.take.stock.reviewTakeModal',['plan_id'=>$plan->id])}}">
                            核实盘点数据
                        </a>
                    @endif

                </div><!-- /.box-body -->
            </div>
        </div>
    </div>
</div>

<div id="modal" class="modal inmodal fade" data-keyboard=false data-backdrop="static"></div>
<div id="download_modal" class="modal inmodal fade"></div>


<script>
    $(document).on('click.modal.data-api', '[data-toggle="modal-plan-items"]', function (e) {
        var $this = $(this);
        modalUrl = $this.data('url');
        if (modalUrl) {

            var $target = $($this.attr('data-target'));
            $target.modal('show');
            $target.html('').load(modalUrl, function () {

            });
        }
    });
</script>






